//
//  RAMessage.h
//  ReplyAssistant
//
//  Created by liaozhenming on 2018/11/22.
//  Copyright © 2018 KK. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "RAObject.h"

@class RASender;
NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, RAMessageType) {
    RAMessageType_Text = 1,          /**<文本*/
    RAMessageType_Image = 2,         /**<图片*/
};

@interface RAMessage : RAObject {
    RAMessageType _type;
    RASender *_senderItem;
}
@property (nonatomic, assign) double timestamp;     //  时间戳
@property (nonatomic, assign) BOOL isSelf;          //  是否为自己发送的消息

@property (nonatomic, readonly) RAMessageType type;         //消息类型-【目前只有文本消息和图片消息】
@property (nonatomic, readonly) NSString *sender;           //消息发送者id
@property (nonatomic, readonly) NSString *senderHeadImg;    //消息发送者头像
@property (nonatomic, readonly) NSDate *timeDate;           //消息时间

@property (nonatomic, readonly) NSDictionary *parmeters;

- (NSString*)kk_showDescription;

@end

#pragma mark - RAMessage(ShowAPIs) Class
@interface RAMessage(ShowAPIs)
- (CGSize)kk_contentSizeWithWidth:(CGFloat)width;
- (NSString*)kk_showTime;
@end


#pragma mark - RATextMessage Class
@interface RATextMessage : RAMessage
@property (nonatomic, strong) NSString *content;

//  初始化文本消息
+ (instancetype)messageWithText:(NSString*)text sender:(RASender*)sender;

@end

#pragma mark - RAImageMessage Class
@interface RAImageMessage : RAMessage
@property (nonatomic, strong) UIImage *image;
@property (nonatomic, strong) NSString *imgPath;
@property (nonatomic, assign) CGSize imgSize;

@property (nonatomic, assign) double progress;

//  初始化图片消息
+ (instancetype)messageWithImagePath:(NSString*)path sender:(RASender*)sender;

//  初始化图片消息
+ (instancetype)messageWithImage:(UIImage*)image sender:(RASender*)sender;
@end

NS_ASSUME_NONNULL_END
